re2: do not include stdlib.h inside a namespace This fixes a compile breakage. R=rsc CC=re2-dev https://codereview.appspot.com/14522047
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 05210dc..be36e81 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS
@@ -29,6 +29,7 @@ Dominic Battré <battre@chromium.org> Dmitriy Vyukov <dvyukov@google.com> John Millikin <jmillikin@gmail.com> +Pawel Hajdan <phajdan.jr@gmail.com> Rob Pike <r@google.com> Russ Cox <rsc@swtch.com> Sanjay Ghemawat <sanjay@google.com>
diff --git a/util/mutex.h b/util/mutex.h index 9787bfb..4a8de4c 100644 --- a/util/mutex.h +++ b/util/mutex.h
@@ -10,6 +10,8 @@ #ifndef RE2_UTIL_MUTEX_H_ #define RE2_UTIL_MUTEX_H_ +#include <stdlib.h> + namespace re2 { #define HAVE_PTHREAD 1 @@ -102,7 +104,6 @@ #elif defined(HAVE_PTHREAD) && defined(HAVE_RWLOCK) -#include <stdlib.h> // for abort() #define SAFE_PTHREAD(fncall) do { if ((fncall) != 0) abort(); } while (0) Mutex::Mutex() { SAFE_PTHREAD(pthread_rwlock_init(&mutex_, NULL)); } @@ -117,7 +118,6 @@ #elif defined(HAVE_PTHREAD) -#include <stdlib.h> // for abort() #define SAFE_PTHREAD(fncall) do { if ((fncall) != 0) abort(); } while (0) Mutex::Mutex() { SAFE_PTHREAD(pthread_mutex_init(&mutex_, NULL)); }